﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

namespace WellDone
{
    public sealed partial class ManagerDialog : Page
    {
        public event EventHandler CloseRequested;
        public bool bCanceled = false;
        public bool bClearPrintQueue = false;
        public bool bReopenChecks = false;
        public bool bCloseChecks = false;
        public bool bDiscount = false;
        public bool bEmployeeChecks = false;
        public bool bGiftCards = false;
        public bool bRefund = false;
        public bool bSettings = false;
        public bool bShowSales = false;
        public bool bTaxExempt = false;
        public bool bTipAdjust = false;
        public bool bVoid = false;
        public ManagerDialog()
        {
            this.InitializeComponent();
        }

        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            // Determine which option was selected
            bClearPrintQueue = rbClearPrintQueue.IsChecked == true;
            bCloseChecks = rbCloseChecks.IsChecked == true;
            bDiscount = rbDiscount.IsChecked == true;
            bEmployeeChecks = rbEmployeeChecks.IsChecked == true;
            bGiftCards = rbGiftCards.IsChecked == true;
            bRefund = rbRefund.IsChecked == true;
            bReopenChecks = rbReopenChecks.IsChecked == true;
            bSettings = rbSettings.IsChecked == true;
            bShowSales = rbShowSales.IsChecked == true;
            bTaxExempt = rbTaxExempt.IsChecked == true;
            bTipAdjust = rbTipAdjustment.IsChecked == true;
            bVoid = rbVoid.IsChecked == true;
            // Close the dialog
            if (this.CloseRequested != null)
            {
                this.CloseRequested(this, EventArgs.Empty);
            }
        }

        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            // Set "Canceled" 
            bCanceled = true;
            if (this.CloseRequested != null)
            {
                this.CloseRequested(this, EventArgs.Empty);
            }
        }
    }
}
